<?php
include('../common/_const.php');
include('../common/common.php');
include('../common/checksession.php');
checksession("../index.php");
include('../../inc/conn.php');

$cat_style		=$_POST['cat_style'];
$ishidden		=$_POST['ishidden'];
$parent_cat		=$_POST['parent_cat'];
$cat_rank		=$_POST['cat_rank'];
$cat_name		=isempty(exquot(excode($_POST['cat_name'])));
$seo_title		=isempty(exquot(excode($_POST['seo_title'])));
$cat_keywords	=isempty(exquot(excode($_POST['cat_keywords'])));
$cat_description=isempty(exquot(excode($_POST['cat_description'])));
$gurl	 		=$_POST["gurl"];

isnum($cat_rank,"请证确填写排序!",$gurl);


$db=db_connect();//数据库连接
$insertKey=" `topid`,`sortrank`,`ishidden`,`typename`,`keywords`,`seotitle`,`channeltype`,`description` ";
$insertValue=" '".$parent_cat."','".$cat_rank."','".$ishidden."','".$cat_name."','".$cat_keywords."','".$seo_title."','".$cat_style."','".$cat_description."' ";

$sql=insert_sql(PRETABLE."arctype",$insertKey,$insertValue);

if($db->query($sql)){
	ShowMsg_h("添加成功","../moduls/catalog_main.php");
}else{
ShowMsg("<font color=\"#FF0000\">未知错误,添加失败!请重新添加!</font>",$gurl);
}
$db->close();
?>